<% layout("/WEB-INF/view/console/skins/skin_2/layout.html", {}) {
%>
<div class="row">
    <div class="col-md-12">
        <div class="widget-container fluid-height clearfix">
            <div class="widget-content padded clearfix">
                <div class='row'>
                    <div class='col-md-12'>
                        <form name="sysDepartment_form" id="sysDepartment_form" class='form-inline'>
                            <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='department_name'  >depa...：</label>
 <input  onkeyup='sysDepartmentConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='departmentName' name='departmentName' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='parent_id'  >pare...：</label>
 <input  onkeyup='sysDepartmentConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='parentId' name='parentId' placeholder=''>
 </div>
 
                        </form>
                    </div>
                </div>
                <div class='row'>
                    <div align="center">
                        <button type='button' class='btn btn-default' id='sysDepartmentQuerySearch'>查询</button>
                        <button type='button' class='btn btn-default' id='sysDepartmentReset'>重置</button>
                    </div>
                </div>
                 <div id="sysDepartmentToolbar" class="btn-group">
                              <button type="button" class="btn btn-default" onclick="consoleOpenWindow('sysDepartment','${ctxPath}/console/sys_department/add','新增')">
                                  <i class="glyphicon glyphicon-plus"></i>
                              </button>
                              <button type="button" class="btn btn-default" onclick='sysDepartmentConsoleGrid.delete("departmentId","${ctxPath}/console/sys_department/delete");'>
                                  <i class="glyphicon glyphicon-trash"></i>
                              </button>
                 </div>
                     <div class='row'>
                              <div class='col-md-12'>
                                  <table id="sysDepartment" data-toggle="table"
                                         data-url="${ctxPath}/console/sys_department/json"
                                         data-pagination="true"
                                         data-query-params="sysDepartmentLoadParam"
                                         method="post"
                                         data-side-pagination="server"
                                         data-show-refresh="true"
                                         data-show-toggle="true"
                                         data-pagination-loop="false"
                                         data-show-columns="true"
                                         data-toolbar="#sysDepartmentToolbar">
                                      <thead>
                                      <tr>
                                           <th data-checkbox="true"></th>
                                            <th data-field='departmentId' data-visible='false'>ID</th>
  <th data-sortable='true' data-field='departmentName'>部门名称</th>
  <th data-sortable='true' data-field='parentId'>父级部门</th>
  <th data-field='departmentId' data-formatter='sysDepartmentTableOperate'>操作</th>
 
                                      </tr>
                                      </thead>
                                  </table>
                              </div>
                     </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
     var sysDepartmentConsoleGrid =new consoleGrid({table_id:"sysDepartment"});
     sysDepartmentConsoleGrid.init();
     function sysDepartmentTableOperate(value){
         return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"sysDepartment\",\"${ctxPath}/console/sys_department/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
     }
    function sysDepartmentLoadParam(params){
        params.query=sysDepartmentQueryString();

        return params;
    }
     function sysDepartmentQueryString() {
         var objQuery = new Object();
                objQuery.departmentName=$('#departmentName').val()==''?null:$('#departmentName').val(); 
     objQuery.parentId=$('#parentId').val()==''?null:$('#parentId').val(); 
 
         var queryString = JSON.stringify(objQuery);
         return queryString;
     }

    
 </script>
<%} %>
 